<?php
/**
 * @version     1.0.0
 * @package     com_shoes
 * @copyright   Copyright (C) 2014. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 * @author      Quang <quang4it@yahoo.com> - http://viseed.com
 */
// no direct access
defined('_JEXEC') or die;

//Load admin language file
$lang = JFactory::getLanguage();
$lang->load('com_shoes', JPATH_ADMINISTRATOR);
$canEdit = JFactory::getUser()->authorise('core.edit', 'com_shoes');
if (!$canEdit && JFactory::getUser()->authorise('core.edit.own', 'com_shoes')) {
	$canEdit = JFactory::getUser()->id == $this->item->created_by;
}
?>
<?php if ($this->item) : ?>

    <div class="item_fields">

        <ul class="fields_list">

            			<li><?php echo JText::_('COM_SHOES_FORM_LBL_SHOE_ID'); ?>:
			<?php echo $this->item->id; ?></li>
			<li><?php echo JText::_('COM_SHOES_FORM_LBL_SHOE_ORDERING'); ?>:
			<?php echo $this->item->ordering; ?></li>
			<li><?php echo JText::_('COM_SHOES_FORM_LBL_SHOE_STATE'); ?>:
			<?php echo $this->item->state; ?></li>
			<li><?php echo JText::_('COM_SHOES_FORM_LBL_SHOE_CHECKED_OUT'); ?>:
			<?php echo $this->item->checked_out; ?></li>
			<li><?php echo JText::_('COM_SHOES_FORM_LBL_SHOE_CHECKED_OUT_TIME'); ?>:
			<?php echo $this->item->checked_out_time; ?></li>
			<li><?php echo JText::_('COM_SHOES_FORM_LBL_SHOE_CREATED_BY'); ?>:
			<?php echo $this->item->created_by; ?></li>
			<li><?php echo JText::_('COM_SHOES_FORM_LBL_SHOE_TITLE'); ?>:
			<?php echo $this->item->title; ?></li>
			<li><?php echo JText::_('COM_SHOES_FORM_LBL_SHOE_SHORT_DESC'); ?>:
			<?php echo $this->item->short_desc; ?></li>
			<li><?php echo JText::_('COM_SHOES_FORM_LBL_SHOE_LONG_DESC'); ?>:
			<?php echo $this->item->long_desc; ?></li>
			<li><?php echo JText::_('COM_SHOES_FORM_LBL_SHOE_LARGE_IMAGE'); ?>:
			<?php echo $this->item->large_image; ?></li>
			<li><?php echo JText::_('COM_SHOES_FORM_LBL_SHOE_MEDIUM_IMGAGE'); ?>:
			<?php echo $this->item->medium_imgage; ?></li>
			<li><?php echo JText::_('COM_SHOES_FORM_LBL_SHOE_THUMB_IMAGE'); ?>:
			<?php echo $this->item->thumb_image; ?></li>


        </ul>

    </div>
    <?php if($canEdit): ?>
		<a href="<?php echo JRoute::_('index.php?option=com_shoes&task=shoe.edit&id='.$this->item->id); ?>"><?php echo JText::_("COM_SHOES_EDIT_ITEM"); ?></a>
	<?php endif; ?>
								<?php if(JFactory::getUser()->authorise('core.delete','com_shoes')):
								?>
									<a href="javascript:document.getElementById('form-shoe-delete-<?php echo $this->item->id ?>').submit()"><?php echo JText::_("COM_SHOES_DELETE_ITEM"); ?></a>
									<form id="form-shoe-delete-<?php echo $this->item->id; ?>" style="display:inline" action="<?php echo JRoute::_('index.php?option=com_shoes&task=shoe.remove'); ?>" method="post" class="form-validate" enctype="multipart/form-data">
										<input type="hidden" name="jform[id]" value="<?php echo $this->item->id; ?>" />
										<input type="hidden" name="jform[ordering]" value="<?php echo $this->item->ordering; ?>" />
										<input type="hidden" name="jform[state]" value="<?php echo $this->item->state; ?>" />
										<input type="hidden" name="jform[checked_out]" value="<?php echo $this->item->checked_out; ?>" />
										<input type="hidden" name="jform[checked_out_time]" value="<?php echo $this->item->checked_out_time; ?>" />
										<input type="hidden" name="jform[created_by]" value="<?php echo $this->item->created_by; ?>" />
										<input type="hidden" name="jform[title]" value="<?php echo $this->item->title; ?>" />
										<input type="hidden" name="jform[short_desc]" value="<?php echo $this->item->short_desc; ?>" />
										<input type="hidden" name="jform[long_desc]" value="<?php echo $this->item->long_desc; ?>" />
										<input type="hidden" name="jform[large_image]" value="<?php echo $this->item->large_image; ?>" />
										<input type="hidden" name="jform[medium_imgage]" value="<?php echo $this->item->medium_imgage; ?>" />
										<input type="hidden" name="jform[thumb_image]" value="<?php echo $this->item->thumb_image; ?>" />
										<input type="hidden" name="option" value="com_shoes" />
										<input type="hidden" name="task" value="shoe.remove" />
										<?php echo JHtml::_('form.token'); ?>
									</form>
								<?php
								endif;
							?>
<?php
else:
    echo JText::_('COM_SHOES_ITEM_NOT_LOADED');
endif;
?>
